#ifndef SDL_GAMESTATE_H_
#define SDL_GAMESTATE_H_

#include "EventHandler.h"
#include <string>

/* Abstract base class to uniform the gamestate management technique 
 * The Game singleton abstracts all of its updating and drawing to a gamestate 
 * which internally manage what is active and what is not 
 */
class SDL_GameState : public EventHandler
{
public:
    SDL_GameState()
    {
        m_initialised = false;
    }
    virtual ~SDL_GameState()		{}
	virtual void Update()		= 0;
	virtual void Draw()			= 0;
	virtual void Initialise()	= 0;
	virtual void CleanUp()		{}
	virtual void ChangeState(SDL_GameState*);
	virtual void OnResume()		{}
    const bool IsInitialised() const
    {
        return m_initialised;
    }
    void SetVsync(int interval = 1);
    void CheckErrors();
    void RenderText(float x, float y, const std::string& s, float r, float g, float b);
    float Random(float min, float max);

protected:
	bool m_initialised;
};

#endif
